<!DOCTYPE html>
<html>
<head>
    <% include common/meta.ejs %>
    <title>账户登录</title>
    <% include common/public.ejs %>
</head>
<body ontouchstart class="bg_zi">
<article>
    <div class="search_cyc">
        <div class=" p_10 bg_logo"></div>
        <form role="form" id="form" style="padding: 20px;">
            <input type="text" name="id" value="o10Itw9VllOp3jJIh1lpSyAyS5Zg" style="height: 35px;width: 100%;">
        </form>
    </div>
    <footer>
        <div class="footer_box"><a href="javascript:void(0);" class="weui_btn weui_btn_warn" id="submit"
                                   data-redirect="<%= redirect %>">确定</a></div>
    </footer>
</article>
<% include common/footer.ejs %>
<script>
    $(function () {
        $('#submit').click(function () {
            var data = Dolphin.form.getValue('form');
            console.log(data);
            var redirectUrl = $(this).data('redirect') || '<%= global.config.viewPrefix %>/index';
            Dolphin.ajax({
                url: '<%= global.config.contextPath == '/' ? '' : global.config.contextPath %>/login',
                type: Dolphin.requestMethod.POST,
                data: Dolphin.json2string(data),
                forceUrl: true,
                onSuccess: function (reData) {
                    if (reData.success)
                        Dolphin.goUrl(redirectUrl);
                    else
                        alert('登录失败');
                }
            });
        });
    });
</script>
</body>
</html>
